<?php

namespace app\admin\model;

use think\Model;


class Zizhudaochu extends Model
{

    

    

    // 表名
    protected $name = 'order';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'is_agency_text',
        'platform_type_text',
        'is_callback_text',
        'order_status_text',
        'is_recharged_text',
        'callback_time_text',
        'jiesuan_time_text',
        'settlement_time_text',
        'actime_text',
        'audit_time_text',
        'baoxiao_status_text',
        'recover_status_text',
        'recover_time_text',
        'audit_upload_time_text',
        'baoxiao_time_text',
        'is_up_text',
        'admin_time_text',
        'is_hexiao_text',
        'hexiao_js_time_text',
        'hexiao_time_text',
        'hexiao_next_time_text',
        'is_more_text',
        'two_js_time_text',
        'is_verification_text',
        'is_tripartite_settlement_text'
    ];


    public function getIsAgencyList()
    {
        return ['1' => __('Is_agency 1'), '2' => __('Is_agency 2')];
    }

    public function getPlatformTypeList()
    {
        return ['1' => __('Platform_type 1'), '2' => __('Platform_type 2'), '3' => __('Platform_type 3')];
    }

    public function getIsCallbackList()
    {
        return ['1' => __('Is_callback 1'), '2' => __('Is_callback 2')];
    }

    public function getOrderStatusList()
    {
        return ['0' => __('Order_status 0'), '1' => __('Order_status 1'), '2' => __('Order_status 2'), '3' => __('Order_status 3'), '4' => __('Order_status 4'), '5' => __('Order_status 5'), '6' => __('Order_status 6')];
    }

    public function getIsRechargedList()
    {
        return ['0' => __('Is_recharged 0'), '1' => __('Is_recharged 1')];
    }

    public function getBaoxiaoStatusList()
    {
        return ['0' => __('Baoxiao_status 0'), '1' => __('Baoxiao_status 1'), '2' => __('Baoxiao_status 2'), '平台2 说明：1' => __('Baoxiao_status 平台2 说明：1'), '3' => __('Baoxiao_status 3'), '4' => __('Baoxiao_status 4'), '5' => __('Baoxiao_status 5'), '6' => __('Baoxiao_status 6')];
    }

    public function getRecoverStatusList()
    {
        return ['1' => __('Recover_status 1'), '2' => __('Recover_status 2')];
    }

    public function getIsUpList()
    {
        return ['1' => __('Is_up 1'), '2' => __('Is_up 2')];
    }

    public function getIsHexiaoList()
    {
        return ['1' => __('Is_hexiao 1'), '2' => __('Is_hexiao 2'), '3' => __('Is_hexiao 3'), '4' => __('Is_hexiao 4'), '5' => __('Is_hexiao 5'), '6' => __('Is_hexiao 6'), '7' => __('Is_hexiao 7'), '8' => __('Is_hexiao 8'), '9' => __('Is_hexiao 9')];
    }

    public function getIsMoreList()
    {
        return ['1' => __('Is_more 1'), '2' => __('Is_more 2'), '3' => __('Is_more 3')];
    }

    public function getIsVerificationList()
    {
        return ['1' => __('Is_verification 1'), '0' => __('Is_verification 0')];
    }

    public function getIsTripartiteSettlementList()
    {
        return ['0' => __('Is_tripartite_settlement 0'), '1' => __('Is_tripartite_settlement 1')];
    }


    public function getIsAgencyTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_agency']) ? $data['is_agency'] : '');
        $list = $this->getIsAgencyList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getPlatformTypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['platform_type']) ? $data['platform_type'] : '');
        $list = $this->getPlatformTypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getIsCallbackTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_callback']) ? $data['is_callback'] : '');
        $list = $this->getIsCallbackList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getOrderStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['order_status']) ? $data['order_status'] : '');
        $list = $this->getOrderStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getIsRechargedTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_recharged']) ? $data['is_recharged'] : '');
        $list = $this->getIsRechargedList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getCallbackTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['callback_time']) ? $data['callback_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getJiesuanTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['jiesuan_time']) ? $data['jiesuan_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getSettlementTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['settlement_time']) ? $data['settlement_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getActimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['actime']) ? $data['actime'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getAuditTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['audit_time']) ? $data['audit_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getBaoxiaoStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['baoxiao_status']) ? $data['baoxiao_status'] : '');
        $list = $this->getBaoxiaoStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getRecoverStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['recover_status']) ? $data['recover_status'] : '');
        $list = $this->getRecoverStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getRecoverTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['recover_time']) ? $data['recover_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getAuditUploadTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['audit_upload_time']) ? $data['audit_upload_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getBaoxiaoTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['baoxiao_time']) ? $data['baoxiao_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getIsUpTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_up']) ? $data['is_up'] : '');
        $list = $this->getIsUpList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getAdminTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['admin_time']) ? $data['admin_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getIsHexiaoTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_hexiao']) ? $data['is_hexiao'] : '');
        $list = $this->getIsHexiaoList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getHexiaoJsTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['hexiao_js_time']) ? $data['hexiao_js_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getHexiaoTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['hexiao_time']) ? $data['hexiao_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getHexiaoNextTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['hexiao_next_time']) ? $data['hexiao_next_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getIsMoreTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_more']) ? $data['is_more'] : '');
        $list = $this->getIsMoreList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getTwoJsTimeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['two_js_time']) ? $data['two_js_time'] : '');
        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
    }


    public function getIsVerificationTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_verification']) ? $data['is_verification'] : '');
        $list = $this->getIsVerificationList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getIsTripartiteSettlementTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_tripartite_settlement']) ? $data['is_tripartite_settlement'] : '');
        $list = $this->getIsTripartiteSettlementList();
        return isset($list[$value]) ? $list[$value] : '';
    }

    protected function setCallbackTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setJiesuanTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setSettlementTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setActimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setAuditTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setRecoverTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setAuditUploadTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setBaoxiaoTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setAdminTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setHexiaoJsTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setHexiaoTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setHexiaoNextTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }

    protected function setTwoJsTimeAttr($value)
    {
        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
    }


}
